<?php
return array(
    'controllers' => array(
        'factories' => array(
            'Admin\Controller\Index' =>
            'Admin\Factory\Controller\IndexControllerFactory',
            'Admin\Controller\Catalog' =>
            'Admin\Factory\Controller\CatalogControllerFactory',
            'Admin\Controller\Template' =>
            'Admin\Factory\Controller\TemplateControllerFactory',
            'Admin\Controller\User' =>
            'Admin\Factory\Controller\UserControllerFactory',
            'Admin\Controller\Block' =>
            'Admin\Factory\Controller\BlockControllerFactory',
            'Admin\Controller\Page' =>
            'Admin\Factory\Controller\PageControllerFactory',
            'Admin\Controller\Common' =>
            'Admin\Factory\Controller\CommonControllerFactory',
            'Admin\Controller\Menu' =>
            'Admin\Factory\Controller\MenuControllerFactory',
            'Admin\Controller\Role' =>
            'Admin\Factory\Controller\RoleControllerFactory',
            'Admin\Controller\Dish' =>
            'Admin\Factory\Controller\DishControllerFactory',
            'Admin\Controller\Article' =>
            'Admin\Factory\Controller\ArticleControllerFactory',
            'Admin\Controller\Restaurant' =>
            'Admin\Factory\Controller\RestaurantControllerFactory',
        ),
        'invokables' => array(
            'Admin\Controller\Login' =>
            'Admin\Controller\LoginController'
        ),
    ),

    'router' => array(
        'routes' => array(
            'admin' => array(
                'type' => 'segment',
                'options' => array(
                    'route' => '/admin',
                    'defaults' => array(
                        'controller' => 'Admin\Controller\Index',
                        'action' => 'index'
                    )
                ),
                'may_terminate' => true,
                'child_routes' => array(
                    'index' => array(
                        'type' => 'segment',
                        'options' => array(
                            'route' => '/index[/:action]',
                            'defaults' => array(
                                'controller' => 'Admin\Controller\Index',
                                'action' => 'index'
                            )

                        )
                    ),
                    'login' => array(
                        'type' => 'segment',
                        'options' => array(
                            'route' => '/login[/:action]',
                            'defaults' => array(
                                'controller' => 'Admin\Controller\Login',
                                'action' => 'index'
                            )

                        )
                    ),
                    'catalog' => array(
                        'type' => 'segment',
                        'options' => array(
                            'route' => '/catalog[/:action]',
                            'defaults' => array(
                                'controller' => 'Admin\Controller\Catalog',
                                'action' => 'index'
                            )
                        )
                    ),
                    'template' => array(
                        'type' => 'segment',
                        'options' => array(
                            'route' => '/template[/:action]',
                            'defaults' => array(
                                'controller' => 'Admin\Controller\Template',
                                'action' => 'index',

                            )
                        )
                    ),
                    'user' => array(
                        'type' => 'segment',
                        'options' => array(
                            'route' => '/user[/:action]',
                            'defaults' => array(
                                'controller' => 'Admin\Controller\User',
                                'action' => 'index',

                            )
                        )
                    ),
                    'block' => array(
                        'type' => 'segment',
                        'options' => array(
                            'route' => '/block[/:action]',
                            'defaults' => array(
                                'controller' => 'Admin\Controller\Block',
                                'action' => 'block-class',

                            )
                        )
                    ),
                    'page' => array(
                        'type' => 'segment',
                        'options' => array(
                            'route' => '/page[/:action]',
                            'defaults' => array(
                                'controller' => 'Admin\Controller\Page',
                                'action' => 'index',

                            )
                        )
                    ),
                    'common' => array(
                        'type' => 'segment',
                        'options' => array(
                            'route' => '/common[/:action]',
                            'defaults' => array(
                                'controller' => 'Admin\Controller\Common',
                                'action' => 'index',
                            )
                        )
                    ),
                    'menu' => array(
                        'type' => 'segment',
                        'options' => array(
                            'route' => '/menu[/:action]',
                            'defaults' => array(
                                'controller' => 'Admin\Controller\Menu',
                                'action' => 'index',

                            )
                        )
                    ),
                    'article' => array(
                        'type' => 'segment',
                        'options' => array(
                            'route' => '/article[/:action]',
                            'defaults' => array(
                                'controller' => 'Admin\Controller\Article',
                                'action' => 'index',
                            )
                        )
                    ),
                    'role' => array(
                        'type' => 'segment',
                        'options' => array(
                            'route' => '/role[/:action]',
                            'defaults' => array(
                                'controller' => 'Admin\Controller\Role',
                                'action' => 'index',
                            )
                        )
                    ),
                    'dish' => array(
                        'type' => 'segment',
                        'options' => array(
                            'route' => '/dish[/:action]',
                            'defaults' => array(
                                'controller' => 'Admin\Controller\Dish',
                                'action' => 'index',
                            )
                        )
                    ),
                    'restaurant' => array(
                        'type' => 'segment',
                        'options' => array(
                            'route' => '/restaurant[/:action]',
                            'defaults' => array(
                                'controller' => 'Admin\Controller\Restaurant',
                                'action' => 'index',
                            )
                        )
                    ),
                )
            ),
        ),
    ),

    'view_manager' => array(
        'template_map' => array(
            'admin/index/index' => __DIR__ .  '/../view/admin/index/index.php',
            'error/index'             => __DIR__ . '/../view/error/index.php',
            'error/404'               => __DIR__ . '/../view/error/404.php',
//            'admin/layout'           => __DIR__ . '/../view/layout/admin_layout.php',
        ),
        'template_path_stack' => array(
            __DIR__ . '/../view',
            __DIR__ . '/../view/layout',
        ),
        'strategies' => array(
            'ViewJsonStrategy',
        ),
        'display_exceptions' => true,
        'exception_template' => 'error/index',
        'display_not_found_reason' => true,
        'not_found_template'       => 'error/404',
        'default_template_suffix'=>'php',
//        'layout' => 'admin/layout',


    )


);
?>